package helper;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import javax.swing.JFrame;

import view.MainMenu;

public class DialogListener implements WindowListener {
	MainMenu menu;
	public DialogListener(JFrame ref) {
		this.menu = (MainMenu) ref;
	}

	@Override
	public void windowActivated(WindowEvent e) {

	}

	@Override
	public void windowClosed(WindowEvent e) {
		menu.getBoard().startTimer();

	}

	@Override
	public void windowClosing(WindowEvent e) {
		menu.getBoard().startTimer();

	}

	@Override
	public void windowDeactivated(WindowEvent e) {

	}

	@Override
	public void windowDeiconified(WindowEvent e) {

	}

	@Override
	public void windowIconified(WindowEvent e) {

	}

	@Override
	public void windowOpened(WindowEvent e) {
		menu.getBoard().stopTimer();

	}

}
